﻿using Messhall.Application.Dto;
using Messhall.Application.Dto.Permissions.Requests;
using Messhall.Application.Dto.Permissions.Responses;
using Microsoft.AspNetCore.Mvc;

namespace Messhall.HostService.Interface.Permission;

[Messhall.Framework.Attributes.Route("/api/permission")]
public interface IPermission
{
    /// <summary>
    /// 获取树型结构
    /// </summary>
    [HttpGet]
    [Route("gettree")]
    Task<List<PermissionTreeResponse>> GetTreeAsync();

    /// <summary>
    /// 获取详情
    /// </summary>
    [HttpGet]
    [Route("get")]
    Task<PermissionDetailsResponse> GetDetailsAsync(RequestKeyIdBase request);
    
    /// <summary>
    /// 创建菜单
    /// </summary>
    /// <returns></returns>
    [HttpPost]
    [Route("create")]
    Task<bool> CreateAsync([FromBody] CreatePermissionRequest request);

    /// <summary>
    /// 删除菜单
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpDelete]
    [Route("remove")]
    Task<bool> RemoveAsync([FromBody] RemovePermissionRequest request);

}